DOX = doxygen

.PHONY: figures php

all: doc doc_pdf

clean:
	rm -rf html; rm -rf latex
	@cd figures;${MAKE} clean

doc_pdf: doc
	@cd latex; ${MAKE}
	@cp latex/refman.pdf fulguro_api.pdf

doc: figures cost_estimation php
	$(DOX) Doxyfile
	cp logo.png html
	cp -r wrapper html
	rm -rf html/wrapper/CVS
	cp benchmark/*.gif html
	cp benchmark/*.html html

figures:
	mkdir -p html
	cd figures;${MAKE} all

cost_estimation:
	mkdir -p html
	sloccount --wide --multiproject .. > result.txt
	sloc2html.py result.txt | head -n -2 > html/cost_estimation.html
	cat logo_sf.html >> html/cost_estimation.html
	echo '</body></html>' >> html/cost_estimation.html
php:
	mkdir -p html/php
	cp php/*.php html/php
	cp php/*.html html/php
